Autogenerated HTML docs for v2.28.0-202-g7814e8
diff --git a/git-worktree.html b/git-worktree.html index c6824a8..4d318f5 100644 --- a/git-worktree.html +++ b/git-worktree.html
@@ -767,8 +767,9 @@ <div class="paragraph"><p>A git repository can support multiple working trees, allowing you to check out more than one branch at a time. With <code>git worktree add</code> a new working tree is associated with the repository. This new working tree is called a -"linked working tree" as opposed to the "main working tree" prepared by "git -init" or "git clone". A repository has one main working tree (if it’s not a +"linked working tree" as opposed to the "main working tree" prepared by +<a href="git-init.html">git-init(1)</a> or <a href="git-clone.html">git-clone(1)</a>. +A repository has one main working tree (if it’s not a bare repository) and zero or more linked working trees. When you are done with a linked working tree, remove it with <code>git worktree remove</code>.</p></div> <div class="paragraph"><p>If a working tree is deleted without using <code>git worktree remove</code>, then @@ -794,10 +795,10 @@ <p> Create <code><path></code> and checkout <code><commit-ish></code> into it. The new working directory is linked to the current repository, sharing everything except working -directory specific files such as HEAD, index, etc. <code>-</code> may also be -specified as <code><commit-ish></code>; it is synonymous with <code>@{-1}</code>. +directory specific files such as <code>HEAD</code>, <code>index</code>, etc. As a convenience, +<code><commit-ish></code> may be a bare "<code>-</code>", which is synonymous with <code>@{-1}</code>. </p> -<div class="paragraph"><p>If <commit-ish> is a branch name (call it <code><branch></code>) and is not found, +<div class="paragraph"><p>If <code><commit-ish></code> is a branch name (call it <code><branch></code>) and is not found, and neither <code>-b</code> nor <code>-B</code> nor <code>--detach</code> are used, but there does exist a tracking branch in exactly one remote (call it <code><remote></code>) with a matching name, treat as equivalent to:</p></div> @@ -811,15 +812,15 @@ unique across all remotes. Set it to e.g. <code>checkout.defaultRemote=origin</code> to always checkout remote branches from there if <code><branch></code> is ambiguous but exists on the -<em>origin</em> remote. See also <code>checkout.defaultRemote</code> in +<code>origin</code> remote. See also <code>checkout.defaultRemote</code> in <a href="git-config.html">git-config(1)</a>.</p></div> <div class="paragraph"><p>If <code><commit-ish></code> is omitted and neither <code>-b</code> nor <code>-B</code> nor <code>--detach</code> used, -then, as a convenience, the new worktree is associated with a branch +then, as a convenience, the new working tree is associated with a branch (call it <code><branch></code>) named after <code>$(basename <path>)</code>. If <code><branch></code> -doesn’t exist, a new branch based on HEAD is automatically created as +doesn’t exist, a new branch based on <code>HEAD</code> is automatically created as if <code>-b <branch></code> was given. If <code><branch></code> does exist, it will be -checked out in the new worktree, if it’s not checked out anywhere -else, otherwise the command will refuse to create the worktree (unless +checked out in the new working tree, if it’s not checked out anywhere +else, otherwise the command will refuse to create the working tree (unless <code>--force</code> is used).</p></div> </dd> <dt class="hdlist1"> @@ -827,10 +828,10 @@ </dt> <dd> <p> -List details of each worktree. The main worktree is listed first, followed by -each of the linked worktrees. The output details include if the worktree is -bare, the revision currently checked out, and the branch currently checked out -(or <em>detached HEAD</em> if none). +List details of each working tree. The main working tree is listed first, +followed by each of the linked working trees. The output details include +whether the working tree is bare, the revision currently checked out, and the +branch currently checked out (or "detached HEAD" if none). </p> </dd> <dt class="hdlist1"> @@ -859,7 +860,7 @@ </dt> <dd> <p> -Prune working tree information in $GIT_DIR/worktrees. +Prune working tree information in <code>$GIT_DIR/worktrees</code>. </p> </dd> <dt class="hdlist1"> @@ -906,7 +907,7 @@ <div class="paragraph"><p><code>move</code> refuses to move a locked working tree unless <code>--force</code> is specified twice. If the destination is already assigned to some other working tree but is missing (for instance, if <code><new-path></code> was deleted manually), then <code>--force</code> -allows the move to proceed; use --force twice if the destination is locked.</p></div> +allows the move to proceed; use <code>--force</code> twice if the destination is locked.</p></div> <div class="paragraph"><p><code>remove</code> refuses to remove an unclean working tree unless <code>--force</code> is used. To remove a locked working tree, specify <code>--force</code> twice.</p></div> </dd> @@ -920,7 +921,7 @@ <p> With <code>add</code>, create a new branch named <code><new-branch></code> starting at <code><commit-ish></code>, and check out <code><new-branch></code> into the new working tree. - If <code><commit-ish></code> is omitted, it defaults to HEAD. + If <code><commit-ish></code> is omitted, it defaults to <code>HEAD</code>. By default, <code>-b</code> refuses to create a new branch if it already exists. <code>-B</code> overrides this safeguard, resetting <code><new-branch></code> to <code><commit-ish></code>. @@ -931,7 +932,7 @@ </dt> <dd> <p> - With <code>add</code>, detach HEAD in the new working tree. See "DETACHED HEAD" + With <code>add</code>, detach <code>HEAD</code> in the new working tree. See "DETACHED HEAD" in <a href="git-checkout.html">git-checkout(1)</a>. </p> </dd> @@ -952,7 +953,7 @@ <dd> <p> With <code>worktree add <path></code>, without <code><commit-ish></code>, instead - of creating a new branch from HEAD, if there exists a tracking + of creating a new branch from <code>HEAD</code>, if there exists a tracking branch in exactly one remote matching the basename of <code><path></code>, base the new branch on the remote-tracking branch, and mark the remote-tracking branch as "upstream" from the new branch. @@ -968,7 +969,7 @@ When creating a new branch, if <code><commit-ish></code> is a branch, mark it as "upstream" from the new branch. This is the default if <code><commit-ish></code> is a remote-tracking branch. See - "--track" in <a href="git-branch.html">git-branch(1)</a> for details. + <code>--track</code> in <a href="git-branch.html">git-branch(1)</a> for details. </p> </dd> <dt class="hdlist1"> @@ -978,7 +979,7 @@ <p> Keep the working tree locked after creation. This is the equivalent of <code>git worktree lock</code> after <code>git worktree add</code>, - but without race condition. + but without a race condition. </p> </dd> <dt class="hdlist1"> @@ -1011,7 +1012,7 @@ </dt> <dd> <p> - With <em>add</em>, suppress feedback messages. + With <code>add</code>, suppress feedback messages. </p> </dd> <dt class="hdlist1"> @@ -1030,7 +1031,7 @@ </dt> <dd> <p> - With <code>prune</code>, only expire unused working trees older than <time>. + With <code>prune</code>, only expire unused working trees older than <code><time></code>. </p> </dd> <dt class="hdlist1"> @@ -1050,9 +1051,9 @@ absolute. </p> <div class="paragraph"><p>If the last path components in the working tree’s path is unique among -working trees, it can be used to identify worktrees. For example if -you only have two working trees, at "/abc/def/ghi" and "/abc/def/ggg", -then "ghi" or "def/ghi" is enough to point to the former working tree.</p></div> +working trees, it can be used to identify a working tree. For example if +you only have two working trees, at <code>/abc/def/ghi</code> and <code>/abc/def/ggg</code>, +then <code>ghi</code> or <code>def/ghi</code> is enough to point to the former working tree.</p></div> </dd> </dl></div> </div> @@ -1061,25 +1062,25 @@ <h2 id="_refs">REFS</h2> <div class="sectionbody"> <div class="paragraph"><p>In multiple working trees, some refs may be shared between all working -trees, some refs are local. One example is HEAD is different for all -working trees. This section is about the sharing rules and how to access +trees and some refs are local. One example is <code>HEAD</code> which is different for each +working tree. This section is about the sharing rules and how to access refs of one working tree from another.</p></div> <div class="paragraph"><p>In general, all pseudo refs are per working tree and all refs starting -with "refs/" are shared. Pseudo refs are ones like HEAD which are -directly under GIT_DIR instead of inside GIT_DIR/refs. There is one -exception to this: refs inside refs/bisect and refs/worktree is not +with <code>refs/</code> are shared. Pseudo refs are ones like <code>HEAD</code> which are +directly under <code>$GIT_DIR</code> instead of inside <code>$GIT_DIR/refs</code>. There are +exceptions, however: refs inside <code>refs/bisect</code> and <code>refs/worktree</code> are not shared.</p></div> <div class="paragraph"><p>Refs that are per working tree can still be accessed from another -working tree via two special paths, main-worktree and worktrees. The -former gives access to per-worktree refs of the main working tree, +working tree via two special paths, <code>main-worktree</code> and <code>worktrees</code>. The +former gives access to per-working tree refs of the main working tree, while the latter to all linked working trees.</p></div> -<div class="paragraph"><p>For example, main-worktree/HEAD or main-worktree/refs/bisect/good -resolve to the same value as the main working tree’s HEAD and -refs/bisect/good respectively. Similarly, worktrees/foo/HEAD or -worktrees/bar/refs/bisect/bad are the same as -GIT_COMMON_DIR/worktrees/foo/HEAD and -GIT_COMMON_DIR/worktrees/bar/refs/bisect/bad.</p></div> -<div class="paragraph"><p>To access refs, it’s best not to look inside GIT_DIR directly. Instead +<div class="paragraph"><p>For example, <code>main-worktree/HEAD</code> or <code>main-worktree/refs/bisect/good</code> +resolve to the same value as the main working tree’s <code>HEAD</code> and +<code>refs/bisect/good</code> respectively. Similarly, <code>worktrees/foo/HEAD</code> or +<code>worktrees/bar/refs/bisect/bad</code> are the same as +<code>$GIT_COMMON_DIR/worktrees/foo/HEAD</code> and +<code>$GIT_COMMON_DIR/worktrees/bar/refs/bisect/bad</code>.</p></div> +<div class="paragraph"><p>To access refs, it’s best not to look inside <code>$GIT_DIR</code> directly. Instead use commands such as <a href="git-rev-parse.html">git-rev-parse(1)</a> or <a href="git-update-ref.html">git-update-ref(1)</a> which will handle refs correctly.</p></div> </div> @@ -1087,12 +1088,12 @@ <div class="sect1"> <h2 id="_configuration_file">CONFIGURATION FILE</h2> <div class="sectionbody"> -<div class="paragraph"><p>By default, the repository "config" file is shared across all working +<div class="paragraph"><p>By default, the repository <code>config</code> file is shared across all working trees. If the config variables <code>core.bare</code> or <code>core.worktree</code> are already present in the config file, they will be applied to the main working trees only.</p></div> <div class="paragraph"><p>In order to have configuration specific to working trees, you can turn -on "worktreeConfig" extension, e.g.:</p></div> +on the <code>worktreeConfig</code> extension, e.g.:</p></div> <div class="listingblock"> <div class="content"> <pre><code>$ git config extensions.worktreeConfig true</code></pre> @@ -1102,7 +1103,7 @@ configuration in this file with <code>git config --worktree</code>. Older Git versions will refuse to access repositories with this extension.</p></div> <div class="paragraph"><p>Note that in this file, the exception for <code>core.bare</code> and <code>core.worktree</code> -is gone. If you have them in $GIT_DIR/config before, you must move +is gone. If they exist in <code>$GIT_DIR/config</code>, you must move them to the <code>config.worktree</code> of the main working tree. You may also take this opportunity to review and move other configuration that you do not want to share to all working trees:</p></div> @@ -1125,55 +1126,55 @@ <h2 id="_details">DETAILS</h2> <div class="sectionbody"> <div class="paragraph"><p>Each linked working tree has a private sub-directory in the repository’s -$GIT_DIR/worktrees directory. The private sub-directory’s name is usually +<code>$GIT_DIR/worktrees</code> directory. The private sub-directory’s name is usually the base name of the linked working tree’s path, possibly appended with a number to make it unique. For example, when <code>$GIT_DIR=/path/main/.git</code> the command <code>git worktree add /path/other/test-next next</code> creates the linked working tree in <code>/path/other/test-next</code> and also creates a <code>$GIT_DIR/worktrees/test-next</code> directory (or <code>$GIT_DIR/worktrees/test-next1</code> if <code>test-next</code> is already taken).</p></div> -<div class="paragraph"><p>Within a linked working tree, $GIT_DIR is set to point to this private +<div class="paragraph"><p>Within a linked working tree, <code>$GIT_DIR</code> is set to point to this private directory (e.g. <code>/path/main/.git/worktrees/test-next</code> in the example) and -$GIT_COMMON_DIR is set to point back to the main working tree’s $GIT_DIR +<code>$GIT_COMMON_DIR</code> is set to point back to the main working tree’s <code>$GIT_DIR</code> (e.g. <code>/path/main/.git</code>). These settings are made in a <code>.git</code> file located at the top directory of the linked working tree.</p></div> <div class="paragraph"><p>Path resolution via <code>git rev-parse --git-path</code> uses either -$GIT_DIR or $GIT_COMMON_DIR depending on the path. For example, in the +<code>$GIT_DIR</code> or <code>$GIT_COMMON_DIR</code> depending on the path. For example, in the linked working tree <code>git rev-parse --git-path HEAD</code> returns <code>/path/main/.git/worktrees/test-next/HEAD</code> (not <code>/path/other/test-next/.git/HEAD</code> or <code>/path/main/.git/HEAD</code>) while <code>git rev-parse --git-path refs/heads/master</code> uses -$GIT_COMMON_DIR and returns <code>/path/main/.git/refs/heads/master</code>, -since refs are shared across all working trees, except refs/bisect and -refs/worktree.</p></div> +<code>$GIT_COMMON_DIR</code> and returns <code>/path/main/.git/refs/heads/master</code>, +since refs are shared across all working trees, except <code>refs/bisect</code> and +<code>refs/worktree</code>.</p></div> <div class="paragraph"><p>See <a href="gitrepository-layout.html">gitrepository-layout(5)</a> for more information. The rule of thumb is do not make any assumption about whether a path belongs to -$GIT_DIR or $GIT_COMMON_DIR when you need to directly access something -inside $GIT_DIR. Use <code>git rev-parse --git-path</code> to get the final path.</p></div> -<div class="paragraph"><p>If you manually move a linked working tree, you need to update the <em>gitdir</em> file +<code>$GIT_DIR</code> or <code>$GIT_COMMON_DIR</code> when you need to directly access something +inside <code>$GIT_DIR</code>. Use <code>git rev-parse --git-path</code> to get the final path.</p></div> +<div class="paragraph"><p>If you manually move a linked working tree, you need to update the <code>gitdir</code> file in the entry’s directory. For example, if a linked working tree is moved to <code>/newpath/test-next</code> and its <code>.git</code> file points to <code>/path/main/.git/worktrees/test-next</code>, then update <code>/path/main/.git/worktrees/test-next/gitdir</code> to reference <code>/newpath/test-next</code> instead.</p></div> -<div class="paragraph"><p>To prevent a $GIT_DIR/worktrees entry from being pruned (which +<div class="paragraph"><p>To prevent a <code>$GIT_DIR/worktrees</code> entry from being pruned (which can be useful in some situations, such as when the entry’s working tree is stored on a portable device), use the <code>git worktree lock</code> command, which adds a file named -<em>locked</em> to the entry’s directory. The file contains the reason in +<code>locked</code> to the entry’s directory. The file contains the reason in plain text. For example, if a linked working tree’s <code>.git</code> file points to <code>/path/main/.git/worktrees/test-next</code> then a file named <code>/path/main/.git/worktrees/test-next/locked</code> will prevent the <code>test-next</code> entry from being pruned. See <a href="gitrepository-layout.html">gitrepository-layout(5)</a> for details.</p></div> -<div class="paragraph"><p>When extensions.worktreeConfig is enabled, the config file +<div class="paragraph"><p>When <code>extensions.worktreeConfig</code> is enabled, the config file <code>.git/worktrees/<id>/config.worktree</code> is read after <code>.git/config</code> is.</p></div> </div> </div> <div class="sect1"> <h2 id="_list_output_format">LIST OUTPUT FORMAT</h2> <div class="sectionbody"> -<div class="paragraph"><p>The worktree list command has two output formats. The default format shows the +<div class="paragraph"><p>The <code>worktree list</code> command has two output formats. The default format shows the details on a single line with columns. For example:</p></div> <div class="listingblock"> <div class="content"> @@ -1185,10 +1186,10 @@ <div class="sect2"> <h3 id="_porcelain_format">Porcelain Format</h3> <div class="paragraph"><p>The porcelain format has a line per attribute. Attributes are listed with a -label and value separated by a single space. Boolean attributes (like <em>bare</em> -and <em>detached</em>) are listed as a label only, and are only present if and only -if the value is true. The first attribute of a worktree is always <code>worktree</code>, -an empty line indicates the end of the record. For example:</p></div> +label and value separated by a single space. Boolean attributes (like <code>bare</code> +and <code>detached</code>) are listed as a label only, and are present only +if the value is true. The first attribute of a working tree is always +<code>worktree</code>, an empty line indicates the end of the record. For example:</p></div> <div class="listingblock"> <div class="content"> <pre><code>$ git worktree list --porcelain @@ -1247,7 +1248,7 @@ <div id="footer"> <div id="footer-text"> Last updated - 2020-06-22 16:55:13 PDT + 2020-08-11 18:39:25 PDT </div> </div> </body>